@extends("admin.frame_layout")
<?php $top_selected = "信息管理";$page_menu = $flag == 0 ? "咨询列表" : "回复列表" ?>
@section('content')
    <div class="rightinfo">
        <div class="tools">
            <form method="get" id="sform" action="{{route('admin.feedback',['flag' => $flag])}}">
                <ul class="toolbar">
                    <li>
                        <input type="text" name="start" placeholder="开始时间"
                               value="{{ isset($_GET['start']) ? $_GET['start'] : '' }}"
                               onClick="laydate({istime: true,format: 'YYYY-MM-DD hh:mm:ss'})">
                    </li>
                    <li>
                        <input type="text" name="end" placeholder="结束时间"
                               value="{{ isset($_GET['end']) ? $_GET['end'] : '' }}"
                               onClick="laydate({istime: true,format: 'YYYY-MM-DD hh:mm:ss'})">
                    </li>
                    <li>
                        <select name="search_type">
                            <option value="1" {{ isset($_GET['search_type']) && $_GET['search_type'] == 1 ? 'selected' : '' }}>
                                按会员账号搜索
                            </option>
                            <option value="2" {{ isset($_GET['search_type']) && $_GET['search_type'] == 2 ? 'selected' : '' }}>
                                按用户ID搜索
                            </option>
                            <option value="3" {{ isset($_GET['search_type']) && $_GET['search_type'] == 3 ? 'selected' : '' }}>
                                按咨询内容搜索
                            </option>
                            <option value="4" {{ isset($_GET['search_type']) && $_GET['search_type'] == 4 ? 'selected' : '' }}>
                                按咨询ID搜索
                            </option>
                        </select>
                    </li>
                    <li>
                        <input id="search_str" name="search_str" type="text" placeholder="搜索条件"
                               value="{{ isset($_GET['search_str']) ? $_GET['search_str'] : '' }}">
                    </li>
                    <li>
                        <select name="sort_type">
                            <option value="1" selected>降序 ↓</option>
                            <option value="2">升序 ↑</option>
                        </select>
                    </li>
                    <li>
                        <a href="javascript:void(0)" onclick="$('#sform').submit()">
                            <span><img src="{{asset('admin/imgs/ico06.png')}}" width="20px"
                                       height="20px"/></span>搜索
                        </a>
                    </li>
                </ul>
            </form>
        </div>

        <table class="tablelist">
            <thead>
            <tr>
                <th width="70px">操作</th>
                <th width="100px">编号<i class="sort"><img src="{{asset('admin/imgs/px.gif')}}"/></i></th>
                <th width="100px">会员ID</th>
                <th width="180px">会员账号</th>
                <th style="text-align: left;">咨询内容</th>
                <th width="100px">状态</th>
                <th width="150px">咨询时间</th>
            </tr>
            </thead>
            <tbody>
            @foreach($feedbacks as $item)
                <tr>
                    <td class="act" bind="#{{ $item->id }}">
                        <img src="{{asset('admin/imgs/t05.png')}}"/>菜单
                        <ul id="{{ $item->id }}">
                            <li>
                                <a href="{{route('admin.feedback.edit',['id'=>$item->id])}}">
                                    <img src="{{asset('admin/imgs/d02.png')}}"/>回复咨询
                                </a>
                            </li>
                            <li onclick="openOkDlg('{{route('admin.feedback.del',['id'=>$item->id])}}')">
                                <img src="{{asset('admin/imgs/d02.png')}}"/>删除
                            </li>
                        </ul>
                    </td>
                    <td>{{ $item->id }}</td>
                    <td>{{ $item->uid }}</td>
                    <td>{{ $item->uname }}</td>
                    <td class="text-left">{{ $item->content }}</td>
                    <td>
                        <span class="{{ $item->status == 0 ? 'red' : 'green' }}">{{ $item->status == 0 ? "未回复" : "已回复" }}</span>
                    </td>
                    <td>{{ date("Y-m-d H:i:s",$item->time) }}</td>
                </tr>
            @endforeach

            </tbody>
        </table>
        @include('admin.coms.fenye')
    </div>

    @include('admin.coms.dialog')
@endsection
@section('footer')
    <script src="{{asset('admin/js/laydate/laydate.js')}}"></script>
    <script type="text/javascript">
        $(document).ready(function () {
            laydate.skin("dahong"); //大红色日期选择皮肤
            //初始化表格操作菜单
            $('.tablelist tbody tr:odd').addClass('odd');
            $(".tablelist .act").hover(function () {
                $($(this).attr("bind")).show();
            }, function () {
                $($(this).attr("bind")).hide();
            });
        });
    </script>
@endsection

